package com.zhai.boot.mq.sender;

import com.zhai.boot.util.DateUtil;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @package: com.zhai.boot.mq.sender
 * @project-name: zhai-boot
 * @description: zhai 推送
 * @author: Created by 翟凤玺
 * @create-datetime: 2018-9-14 15:41
 */

@Component
public class ZhaiSender {

    @Autowired
    private AmqpTemplate rabbitTemplate;

    public void send() {
        String context = "zhai " + DateUtil.getCurrentLocalDateTime();
        System.err.println("推送 : " + context);
        rabbitTemplate.convertAndSend("zhai", context);
    }
}
